
#include "Attack.h"

#include "Character.h"
#include "Player.h"
#include "PlayerStats.h"
#include "Monster.h"
#include "MonsterStats.h"
#include <iostream>
#include <ctime>
#include <cstdlib>


using namespace std;
using namespace Attack;
/*
int main()
{
	srand(time(NULL));
	PlayerStats pStats(5, 5, 5, 5, 100, 100, 1, 100, 100);
	Player p("tom the barbarian", WIZARD, pStats);
	const vector<AttackType>* attacks = p.getAttacks();
	cout << "player damage before equip = " << p.getPlayerStats().getDamage() << endl;
	cout << "player armor before equip = " << p.getPlayerStats().getArmor() << endl;

	EquipmentType head(HEAD);
	EquipmentType chest(CHEST);
	EquipmentType gloves(GLOVES);
	EquipmentType feet(FEET);
	EquipmentType pants(PANTS);
	EquipmentType sword(WEAPON);

	string error;
//	if(!p.equip( &head  ,error ))
//		cout << "Error equipping head: " << error << endl;

//	if(!p.equip( &gloves,error ))
	//	cout << "Error equipping gloves: " << error << endl;
	//if(!p.equip( &feet  ,error ))
	//	cout << "Error equipping feet: " << error << endl;
	//if(!p.equip( &pants ,error ))
	//	cout << "Error equipping pants: " << error << endl;
	if(!p.equip( &chest ,error ))
			cout << "Error equipping chest: " << error << endl;
	if(!p.equip( &sword ,error ))
		cout << "Error equipping sword: " << error << endl;

	cout << "player damage after equip = " << p.getPlayerStats().getDamage() << endl;
	cout << "player armor after equip = " << p.getPlayerStats().getArmor() << endl;
	Monster m(p.getPlayerStats().getLevel());
	
	const vector<AttackType>* monsterAttacks = m.getAttacks();
	cout << "\nMonster: " << m.getDesc() << endl;
	cout << "Monster level: " << m.getMonsterStats().getLevel() << endl;
	for(unsigned int i = 0; i < monsterAttacks->size(); i++){
		cout << monsterAttacks->at(i).getDesc() << endl;
	}

	cout << endl;
	
	// combat loop
	while( true )
	{
	
		// player attacks the monster
		cout << "monster hitpoints before attack = " << m.getMonsterStats().getHitPoints() << endl;
		cout << doAttack(&p, &m, attacks->at(1)) << endl;
		cout << "monster hitpoints after attack = " << m.getMonsterStats().getHitPoints() << endl << endl;
	
		if( m.isDead() )
		{
			cout << "monster died!" << endl; 
			break;
		}
		
		
		// monster attacks the player
		cout << "player hitpoints before = " << p.getPlayerStats().getHitPoints() << endl;
		cout << "player actionpoints before = " << p.getPlayerStats().getActionPoints() << endl;
		cout << "player max actionpoints = " << p.getPlayerStats().getMaxActionPoints() << endl;
		cout << doAttack(&m, &p) << endl;
		cout << "player hitpoints after = " << p.getPlayerStats().getHitPoints() << endl;		
		cout << "player actionpoints after = " << p.getPlayerStats().getActionPoints() << endl << endl;
		
		if( p.isDead() )
		{
			cout << "player died!" << endl; 
			break;
		}		
	}	
	cout << endl;
	
	// current player stats
	cout << "Player current experience: " << p.getPlayerStats().getExp() << endl;
	cout << "Player current level: " << p.getPlayerStats().getLevel() << endl;
	cout << "Player strength: " << p.getPlayerStats().getStrength() << endl;
	cout << "Player agility: " << p.getPlayerStats().getAgility() << endl;
	cout << "Player intelligence: " << p.getPlayerStats().getIntelligence() << endl;
	cout << "Player concentration: " << p.getPlayerStats().getConcentration() << endl;
	cout << "Player num attacks: " << p.getNumAttacks() << endl;
	for(unsigned int i = 0; i < attacks->size(); i++){
		cout << attacks->at(i).getDesc() << endl;
	}
	bool unlocked = p.increaseExp(100);

	attacks = p.getAttacks();
	// player stats after increasing experience
	// should see level and num attacks increase
	cout << "\nPlayer current experience: " << p.getPlayerStats().getExp() << endl;
	cout << "Player current level: " << p.getPlayerStats().getLevel() << endl;
	cout << "Player strength: " << p.getPlayerStats().getStrength() << endl;
	cout << "Player agility: " << p.getPlayerStats().getAgility() << endl;
	cout << "Player intelligence: " << p.getPlayerStats().getIntelligence() << endl;
	cout << "Player concentration: " << p.getPlayerStats().getConcentration() << endl;
	cout << "Player num attacks: " << p.getNumAttacks() << endl;
	
	
	unlocked = p.increaseExp(100);

	attacks = p.getAttacks();
	// player stats after increasing experience
	// should see level and num attacks increase
	cout << "\nPlayer current experience: " << p.getPlayerStats().getExp() << endl;
	cout << "Player current level: " << p.getPlayerStats().getLevel() << endl;
	cout << "Player strength: " << p.getPlayerStats().getStrength() << endl;
	cout << "Player agility: " << p.getPlayerStats().getAgility() << endl;
	cout << "Player intelligence: " << p.getPlayerStats().getIntelligence() << endl;
	cout << "Player concentration: " << p.getPlayerStats().getConcentration() << endl;
	cout << "Player num attacks: " << p.getNumAttacks() << endl;
	
	if(unlocked){
		cout << "unlocked new attack\n";
	}
	
	for(unsigned int i = 0; i < attacks->size(); i++){
		cout << attacks->at(i).getDesc() << endl;
	}
	
	cout << "\n\nplayer hitpoints before regenerate = " << p.getPlayerStats().getHitPoints() << endl;
	p.regenerateHP();
	cout << "player hitpoints after = " << p.getPlayerStats().getHitPoints() << endl;		

	cout << "\n\nplayer actionpoints before regenerate = " << p.getPlayerStats().getActionPoints() << endl;
	p.regenerateAP();
	cout << "player actionpoints after = " << p.getPlayerStats().getActionPoints() << endl;		
	return 0;
}

*/
